"use strict";
var Locale = require("element-ui/lib/mixins/locale");
var EleToolItem = require("../../ele-tool-item");
var ToolColumns = require("./tool-columns");
function _interopDefaultLegacy(e) {
  return e && typeof e === "object" && "default" in e ? e : { "default": e };
}
var Locale__default = /* @__PURE__ */ _interopDefaultLegacy(Locale);
var EleToolItem__default = /* @__PURE__ */ _interopDefaultLegacy(EleToolItem);
var ToolColumns__default = /* @__PURE__ */ _interopDefaultLegacy(ToolColumns);
var render = function() {
  var _vm = this;
  var _h = _vm.$createElement;
  var _c = _vm._self._c || _h;
  return _c("div", { staticClass: "ele-tool ele-space", style: _vm.customStyle }, [_vm._t("default"), _vm._l(_vm.tools, function(tool, index) {
    return [tool === "reload" ? _c("ele-tool-item", { key: "reload" + index, attrs: { "placement": _vm.tipsPlacement, "icon": "el-icon-refresh-right", "title": _vm.t("ele.tableTools.refresh") }, on: { "click": _vm.reload } }) : _vm._e(), tool === "size" ? _c("ele-tool-item", { key: "size" + index, attrs: { "placement": _vm.tipsPlacement, "title": _vm.t("ele.tableTools.size") } }, [_c("el-dropdown", { attrs: { "trigger": "click", "placement": "bottom-end" }, on: { "command": _vm.updateSize } }, [_c("i", { staticClass: "el-icon-_nav" }), _c("el-dropdown-menu", { staticStyle: { "min-width": "80px" }, attrs: { "slot": "dropdown" }, slot: "dropdown" }, [_c("el-dropdown-item", { attrs: { "command": "large" } }, [_c("span", { class: { "ele-text-primary": _vm.size === "large" } }, [_vm._v(" " + _vm._s(_vm.t("ele.tableTools.sizeOption.large")) + " ")])]), _c("el-dropdown-item", { attrs: { "command": "medium" } }, [_c("span", { class: { "ele-text-primary": _vm.size === "medium" } }, [_vm._v(" " + _vm._s(_vm.t("ele.tableTools.sizeOption.medium")) + " ")])]), _c("el-dropdown-item", { attrs: { "command": "small" } }, [_c("span", { class: { "ele-text-primary": _vm.size === "small" } }, [_vm._v(" " + _vm._s(_vm.t("ele.tableTools.sizeOption.small")) + " ")])]), _c("el-dropdown-item", { attrs: { "command": "mini" } }, [_c("span", { class: { "ele-text-primary": _vm.size === "mini" } }, [_vm._v(" " + _vm._s(_vm.t("ele.tableTools.sizeOption.mini")) + " ")])])], 1)], 1)], 1) : _vm._e(), tool === "columns" ? _c("tool-columns", { key: "columns" + index, attrs: { "columns": _vm.columns, "sortable": _vm.columnsSort, "tip-placement": _vm.tipsPlacement, "tip-title": _vm.t("ele.tableTools.columnsOption.columns"), "title": _vm.t("ele.tableTools.columnsOption.columns"), "reset-text": _vm.t("ele.tableTools.columnsOption.reset"), "untitled-text": _vm.t("ele.tableTools.columnsOption.untitled") }, on: { "update:columns": _vm.updateColumns } }) : _vm._e(), tool === "fullscreen" ? _c("ele-tool-item", { key: "fullscreen" + index, attrs: { "placement": _vm.tipsPlacement, "title": _vm.t("ele.tableTools.fullscreen"), "icon": _vm.fullscreen ? "el-icon-_screen-restore" : "el-icon-_screen-full" }, on: { "click": _vm.toggleFullscreen } }) : _vm._e()];
  })], 2);
};
var staticRenderFns = [];
function normalizeComponent(scriptExports, render2, staticRenderFns2, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
  var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
  if (render2) {
    options.render = render2;
    options.staticRenderFns = staticRenderFns2;
    options._compiled = true;
  }
  if (functionalTemplate) {
    options.functional = true;
  }
  if (scopeId) {
    options._scopeId = "data-v-" + scopeId;
  }
  var hook;
  if (moduleIdentifier) {
    hook = function(context) {
      context = context || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
      if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
        context = __VUE_SSR_CONTEXT__;
      }
      if (injectStyles) {
        injectStyles.call(this, context);
      }
      if (context && context._registeredComponents) {
        context._registeredComponents.add(moduleIdentifier);
      }
    };
    options._ssrRegister = hook;
  } else if (injectStyles) {
    hook = shadowMode ? function() {
      injectStyles.call(this, (options.functional ? this.parent : this).$root.$options.shadowRoot);
    } : injectStyles;
  }
  if (hook) {
    if (options.functional) {
      options._injectStyles = hook;
      var originalRender = options.render;
      options.render = function renderWithStyleInjection(h, context) {
        hook.call(context);
        return originalRender(h, context);
      };
    } else {
      var existing = options.beforeCreate;
      options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
    }
  }
  return {
    exports: scriptExports,
    options
  };
}
const __vue2_script = {
  name: "ProTableTools",
  mixins: [Locale__default["default"]],
  components: { EleToolItem: EleToolItem__default["default"], ToolColumns: ToolColumns__default["default"] },
  props: {
    size: {
      type: String,
      default: "medium"
    },
    columns: {
      type: Array,
      default() {
        return [];
      }
    },
    tools: {
      type: Array,
      default() {
        return ["reload", "size", "columns", "fullscreen"];
      }
    },
    columnsSort: {
      type: Boolean,
      default: true
    },
    fullscreen: Boolean,
    customStyle: Object
  },
  emits: ["reload", "update:size", "update:columns", "update:fullscreen"],
  computed: {
    tipsPlacement() {
      return this.fullscreen ? "bottom" : "top";
    }
  },
  methods: {
    reload() {
      this.$emit("reload");
    },
    updateSize(command) {
      this.$emit("update:size", command);
    },
    updateColumns(columns) {
      this.$emit("update:columns", columns);
    },
    toggleFullscreen() {
      this.$emit("update:fullscreen", !this.fullscreen);
    }
  }
};
const __cssModules = {};
var __component__ = /* @__PURE__ */ normalizeComponent(__vue2_script, render, staticRenderFns, false, __vue2_injectStyles, null, null, null);
function __vue2_injectStyles(context) {
  for (let o in __cssModules) {
    this[o] = __cssModules[o];
  }
}
var proTableTools = /* @__PURE__ */ function() {
  return __component__.exports;
}();
module.exports = proTableTools;
